import { HttpClient, HttpException } from '@quick-toolkit/http';

export const http = HttpClient.create({
  headers: {
    'X-Requested-With': 'XMLHttpRequest',
    'Content-Type': 'application/json',
  },
});
http.interceptors.response.use((res) => {
  if (res?.data?.code !== '200') {
    throw new HttpException(res?.config, res, res?.data?.message);
  }

  return res;
});
